package StudyCode.summary.BufferAndChannel;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ReadFromReader {
	public static String readStream(Reader reader) throws IOException {
		StringBuilder result = new StringBuilder();
		BufferedReader in = new BufferedReader(reader);
		String line;
		while ((line = in.readLine()) != null) {
			result.append(line);
			result.append('\n');
		}
		in.close();
		return result.toString();
	}
}
